db = db.getSiblingDB('admin');
print("Starting database initialization...");
// 创建管理员用户
db.createUser(
  {
    user: "yang",
    pwd: "yang123", // 请使用更安全的密码方式，例如环境变量或密钥管理服务
    roles: [ { role: "root", db: "admin" } ]
  }
);

db = db.getSiblingDB('atomdco');
print("Switched to database: " + db.getName());
//db.createCollection('mycollection'); // 创建集合
//db.mycollection.insertMany([{ name: "Alice" }, { name: "Bob" }]);
db.createUser({
  user: "admin",
  pwd: "Zf3LK3NMQ1M",
  roles: [{ role: "readWrite", db: "atomdco" }]
});

print("database initialization success");